package jhlee42;

import java.util.Scanner;

public class J09Retangle {
	public static void main(String[] args) {
		double width[] = new double[2]; // 실수 double
		double height[] = new double[2];
		String color[] = new String[2]; // 문자열 String
		double getAtea[] = new double[2];
		double getPerimeter[] = new double[2];
				
		width[1] = 1.0; // 실수 double
		height[1] = 1.0;
		color[1] = "white"; // 문자열 String
//		getAtea;
//		getPerimeter;	
		
		// 입력하고 결과 도출
		input(width, height, color);
		getcal(getAtea, width, height, getPerimeter);
		output_print(width, height, color, getAtea, getPerimeter);
		
/*      // 문제 데이터 직접 연결시
		getcal(getAtea, width, height, getPerimeter);
		output_print(width, height, color, getAtea, getPerimeter);
		exam_1(width, height, color, getAtea, getPerimeter);
		output_print(width, height, color, getAtea, getPerimeter);
		exam_2(width, height, color, getAtea, getPerimeter);
		output_print(width, height, color, getAtea, getPerimeter);
*/		
	}
	public static void input(double[] width,double[] height, String[] color){
		Scanner sc = new Scanner(System.in);
		System.out.println("가로는?");
		width[1] = sc.nextInt();
		System.out.println("세로는?");
		height[1] = sc.nextInt();
		System.out.println("색상은?");
		color[1] = sc.next();	
	}
	public static void output_print(double[] width,double[] height,String[] color,double[] getAtea,double[] getPerimeter){
		System.out.println("--------------------");
		System.out.println(width[1]);
		System.out.println(height[1]);
		System.out.println(color[1]);
		System.out.println(getAtea[1]);
		System.out.println(getPerimeter[1]);
	}
	public static void getcal(double[] getAtea,double[] width,double[] height,double[] getPerimeter){
		getAtea[1] = width[1] * height[1];
		getPerimeter[1] = (width[1] + height[1]) * 2;
	}
	public static void exam_1(double[] width,double[] height,String[] color,double[] getAtea,double[] getPerimeter){
		width[1] = 4;
		height[1] = 40;
		color[1] = "red";

		getAtea[1] = width[1] * height[1];
		getPerimeter[1] = (width[1] + height[1]) * 2;
	}
	public static void exam_2(double[] width,double[] height,String[] color,double[] getAtea,double[] getPerimeter){
		width[1] = 3.5;
		height[1] = 40;
		color[1] = "orange";

		getAtea[1] = width[1] * height[1];
		getPerimeter[1] = (width[1] + height[1]) * 2;
	}
}
